<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  
    {include file="public/css"}
    {include file="public/js"}
</head>
<body>

<span class="layui-breadcrumb">
  <a href="">首页</a>
  <a href="">全局设置</a>
  <a href="">系统设置</a>
  <a><cite>正文</cite></a>
</span>

<blockquote class="layui-elem-quote" style="margin-top:10px;">说明：</blockquote>

<form class="layui-form" action="">
 <input type="hidden" name="groupname" value="{$Request.controller|strtolower}">


<div class="layui-tab layui-tab-brief " lay-filter="docDemoTabBrief">
  <ul class="layui-tab-title">
    <li class="layui-this">基本设置</li>
    <li>其他配置</li>

  </ul>

  <div class="layui-tab-content" style="height: 100px;">
    <div class="layui-tab-item layui-show">


              <div class="layui-form-item">
               <label class="layui-form-label"> 交易信息审核方式</label>
                  <div class="layui-input-block">
                  <input type="radio" name="data[is_audit_info]" {if  $settings.guarantee.is_audit_info ==1} checked {/if} value="1" title="自动审核" >
                  <input type="radio" name="data[is_audit_info]" {if $settings.guarantee.is_audit_info ==0} checked {/if} value="0" title="人工审核">
                </div>

              </div>  
           
              <div class="layui-form-item">
               <label class="layui-form-label"> 中介手续费</label>
                  <div class="layui-input-inline" style="width:80px;">
                  <input type="text" name="data[fee_ratio]"  value="{$settings.guarantee.fee_ratio}" class="layui-input" >
    
                </div>
                  <div class="layui-form-mid layui-word-aux"> % </div>
              </div>  
              <div class="layui-form-item">
                <label class="layui-form-label"> 自动确认验收</label>
                   <div class="layui-input-block">
                   <input type="radio" name="data[auto_confirm_status]" {if  $settings.guarantee.auto_confirm_status ==1} checked {/if} value="1" title="开启" >
                   <input type="radio" name="data[auto_confirm_status]" {if $settings.guarantee.auto_confirm_status ==0} checked {/if} value="0" title="关闭">
                 </div>
 
               </div>
              <div class="layui-form-item">
               <label class="layui-form-label"> 自动确认验收时间</label>
                  <div class="layui-input-inline" style="width:80px;">
                  <input type="text" name="data[auto_confirm_day]"  value="{$settings.guarantee.auto_confirm_day}" class="layui-input" >
    
                </div>
                  <div class="layui-form-mid layui-word-aux"> 天，表示发货后，规定时间内天内买家未确认收货，系统将自动确认收货，默认好评 </div>
              </div>
              


             <div class="layui-form-item">
               <label class="layui-form-label"> 经纪人QQ</label>
                  <div class="layui-input-inline" style="width:280px;">
                  <textarea name="data[agent_qq]" class="layui-textarea" placeholder="一行一个，格式：名称|qq号">{$settings.guarantee.agent_qq}</textarea>
                </div>
                  <div class="layui-form-mid layui-word-aux"> ，一行一个，格式：名称|qq号,用于展示在交易信息详情页中</div>
              </div>

 </div>
  <div class="layui-tab-item">
         <div class="layui-form-item">
               <label class="layui-form-label"> 交易规则</label>
                  <div class="layui-input-inline"  style="width:600px;padding:10px">
                      {form:ueditor name="data[trade_rule]" value="htmlspecialchars_decode($settings['guarantee']['trade_rule'])"  height="300px"}
                </div>
     
              </div>
         
  </div>
                 <div class="layui-form-item">
                  <label class="layui-form-label"></label>
                    <div class="layui-input-block">
                        <button class="layui-btn layui-btn-normal" id="submit" lay-submit="" lay-submit lay-filter="form" >确 定</button>
                    </div>
</div> 


 </form>


</script>

<script>
layui.use(['form','upload'], function(){
  var form = layui.form;upload = layui.upload;
  

  form.on('submit(form)', function(data){

    var data =data.field;
    $.post("{:url('settings/update')}",data,function(json){
      if(json.code == 0){
        qilecms.success(json.msg);
   
        }else{
          qilecms.error(json.msg);
        }
    });
    return false;
  });




  //普通图片上传
  var uploadInst = upload.render({
    elem: '#upload_img'
    ,url: '{:url("upload/images")}'
    ,before: function(obj){
      //预读本地文件示例，不支持ie8
      obj.preview(function(index, file, result){
        $('#images').attr('src', result); //图片链接（base64）
       
      });
    }
    ,done: function(res){
      //如果上传失败
      if(res.code == -1){
           //上传失败
        return layer.msg(res.msg);
      }else if(res.code ==0){
           //上传成功
       $('#logo').attr('value',res.data);
        return layer.msg(res.msg);
      }
   
    },
    field:"images[]"
    ,error: function(){
      //演示失败状态，并实现重传
      var demoText = $('#demoText');
      demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
      demoText.find('.demo-reload').on('click', function(){
        uploadInst.upload();
      });
    }

});


});
</script>

</body>

</html>